﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NF_IDAL;
using NF_Mode;

namespace NF_DAL
{
    public class SysMenu_DAL<T> where T : class
    {
        /// <summary>
        /// 根据角色获取菜单
        /// </summary>
        /// <returns></returns>
        public static List<dynamic> GetMenuByUserRole(ref BaseAnswer bar)
        {
            List<dynamic> lst = new List<dynamic>();
            try
            {
                var sql = "select * from dbo.V_MenuList";
                lst = DapperQuery<dynamic>.DoQueryListDynamic(sql, null).ToList<dynamic>();
                if (lst.Count > 0) 
                {
                    bar.AnswerMeg = "本次获取信息：" + lst.Count;
                    bar.AnswerType = BaseAnswer.Answers.Succee;
                }
                    
            }
            catch (Exception ex)
            {
                bar.AnswerMeg = ex.Message;
                bar.AnswerType = BaseAnswer.Answers.Error;
            }
            return lst;
        }


    }
}
